package com.zryc.config;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class RequestOriginParserDefinition implements RequestOriginParser {


    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
       //获取请求中sn命名的参数值并返回
        String serviceNameVal= httpServletRequest.getParameter("sn");
        return serviceNameVal;
    }
}
